package com.cheng.student.service.interfaces;

import com.cheng.student.beans.Student;
import com.cheng.student.beans.StudentFull;
import com.cheng.student.dao.InsertFailedException;
import com.fasterxml.jackson.core.JsonProcessingException;

import java.io.InputStream;
import java.util.List;

public interface StudentService
{
    public List<StudentFull> getStudentsByExcel(InputStream excel, int numberOfRows);

    //姓名和考生号
    public Student studentLogin(String name, String number);

    //获取学生
    public StudentFull getStudentFull(String name,String number);

    //获取学生总数
    public int getNumberOfStudent();

    //添加学生，接收一个加载了excel的流
    public void insertStudentsByExcel(InputStream inputStream, int numberOfRows)
            throws InsertFailedException;

    //获取所有studentFull的json字符串{amount:一共能查出来的数量,students=[{},{}]}
    public String getJsonOfStudentFulls(
            String area,
            String gender,
            String academy,
            String major,
            String batch,
            String type,
            int start,
            int end);

    //获取学生对象下面某个字段所有出现过的值
    public String getSuchValuesJson(String key)
            throws JsonProcessingException;

    //更新学生信息
    public boolean updateStudentFull(String name,String number,String key,String value);

    //删除学生
    public int deleteStudent(String name,String number);
}
